#include <string>
#include <iostream>
using namespace std;

int main()
{
	string a("abc");
	string b("abcdefg");
	
	cout << "pos 'b'=" << a.find("b") << endl;//In string a find out the position of the string b.
	cout << "length of a=" << a.length() << endl;
	cout << a << endl;

	cout << "pos\" def\"=" << b.find("def") << endl;//In string b find out the position of the string def.
	cout << "length of b=" << b.length() << endl;
	cout << b << endl;
		
	a.append("EFG");//append "EFG" to the end of string. 
	cout << "length of a=" << a.length() << endl;
	cout << a << endl;
	
	a.insert(3, b);//insert the string b to the back of the three char
	cout << a << endl;
	
	cout << a.compare("ABCDEFG") << endl;//string a and "ABCDEFG" is defference,return 1.
	cout << a.compare(a) << endl;//string a and oneself is the same,return 0.
	
	cout << a.empty() << endl;//string a is not empty,return 0.
	
	a.swap(b);
	cout << "string a is: " << a << endl << "string b ia: " << b <<endl;
		
	return 0;
}
